﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Collections.Generic;
using MvcCms.Data;
using AutoMapper;
using System;

namespace MvcCms.Store.Web.ViewModels
{
    public class ProductViewModel 
    {
        [ScaffoldColumn(false)]
        public int ProductID { get; set; }

        [Required(ErrorMessage = "An Product Category is required")]
        [DisplayName("Category")]
        public int CategoryID { get; set; }

        [Required(ErrorMessage = "An Product Title is required")]
        [StringLength(160)]
        public string Title { get; set; }
        
        [StringLength(500)]
        public string Description { get; set; }

        [Required(ErrorMessage = "Price is required")]
        [Range(0.01, 100.00,
            ErrorMessage = "Price must be between 0.01 and 100.00")]
        public decimal Price { get; set; }

        [DisplayName("Product Image")]
        public string ProductArtUrl { get; set; }

        public bool Active { get; set; }

        public Guid CreatedBy { get; set; }

        public int PortalID { get; set; }

        public virtual StoreCategory Category { get; set; }
        public virtual IList<StoreOrderDetail> OrderDetails { get; set; }
        public virtual IList<StorePricingOption> PricingOptions { get; set; }
    }
}